#ifndef _TEXTURED_SQUARE_
#define _TEXTURED_SQUARE_

#include "Object.h"

/**
	Displays a texture to an aligned rectangle
*/
class Picture: public Object {
	float uMin, uMax;		//The x-axis coordinates for the texture
	float vMin, vMax;		//The y-axis coordinates for the texture
	unsigned textureIndex;	//The texture index to bind to
	
public:
	Picture(const char* textureFile = "", float uMin = 0, float uMax = 1, float vMin = 0, float vMax = 1);
	virtual ~Picture()	{}
	
	//Not much to do on these
	void onLeftClick();
	void onKeyPress();
	void onRollOver();
	
	//Realigns via our local alignments and where the frame is
	void onRealign(float minX, float maxX, float minY, float maxY);
	
	// Get the dimensions for this picture
	void getDimensions(double* width, double* height);
	
	//Draw the texture to the rectangle
	void draw(unsigned long timestamp);
	
	void loadFromXML(ticpp::Node* node, int Z, Frame*);
};

#endif
